<html>
<body>
<?php


if ( !file_exists("temp/lesson-video.swf") ) {

	$myMovie=new SWFMovie(); 
	$myMovie->setDimension(720,480); 
	$myMovie->setBackground(0,0,0); 
	$myMovie->setRate(25); 

	$videoStream = new SWFVideoStream ( fopen ("norah.flv", "rb") );
	$videoStream->setDimension( 720, 480 );

	echo "<p>Frames: ".$videoStream->getNumFrames()."</p>";

	$myMovie->add( $videoStream );

	for ($i=0; $i < $videoStream->getNumFrames(); $i++ ) {
		$myMovie->nextFrame();
	}


	$myMovie->save("temp/lesson-video.swf"); 
}

?>

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" ID=objects WIDTH=720 HEIGHT=600>
<PARAM NAME=movie VALUE="temp/mainVideo.swf">
<EMBED src="temp/mainVideo.swf" WIDTH=720 HEIGHT=600 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> 
</OBJECT>

</body>
</html>